package cn.t.service.order;

import cn.t.core.service.ServiceImpl;
import cn.t.dto.order.OrderQueryRequest;
import cn.t.model.order.OverPickupRecordDO;
import cn.t.model.order.OverPickupRecordVO;
import cn.t.repository.order.OverPickupRecordRepository;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 超领记录表(OverPickupRecord)领域服务
 *
 * @author t
 * @since 2024-05-24 10:19:12
 */
@Slf4j
@Service
@AllArgsConstructor
public class OverPickupRecordService extends ServiceImpl<OverPickupRecordDO, OverPickupRecordRepository> {
    public Boolean addBatch(List<OverPickupRecordDO> exceptionLogList) {
        return repository.addBatch(exceptionLogList);
    }

    public long countQuery(OrderQueryRequest overPickupRecordDO) {
        return repository.countQuery(overPickupRecordDO);
    }

    public List<OverPickupRecordVO> queryOverPickupRecordList(OrderQueryRequest overPickupRecordDO, int start, Integer pageSize) {
        return repository.queryOverPickupRecordList(overPickupRecordDO, start, pageSize, "id", " desc");
    }
    public List<OverPickupRecordVO> queryOverPickupRecordLock(OrderQueryRequest overPickupRecordDO, int start, Integer pageSize) {
        return repository.queryOverPickupRecordLock(overPickupRecordDO, start, pageSize);
    }
    public List<OverPickupRecordDO> queryOverPickupByWorkOrderSn(List<String> workOrderSnList) {
        if (ObjectUtils.isEmpty(workOrderSnList)){
            return Collections.emptyList();
        }
        return repository.queryOverPickupByWorkOrderSn(workOrderSnList);
    }
}
